package com.kksoft.android.xiaoliaobaike.model;

import java.util.HashMap;
import java.util.Map;

import net.tsz.afinal.annotation.sqlite.Id;
import net.tsz.afinal.annotation.sqlite.Table;

@Table(name = "series")
public class Series {

	@Id
	Integer id;

	String title;
	Integer seriesId;
	String seriesUrl;
	String coverUrl;
	String describe;
	int total;
	String firstUrl;
	int mark = 0; // 收藏
	int markOrder = 0; // 收藏顺序

	public Series() {
	}

	/**
	 * 
	 * @param id
	 * @param seriesId
	 * @param title
	 * @param seriesUrl
	 * @param coverUrl
	 * @param describe
	 * @param total
	 * @param firstUrl
	 * @param mark
	 * @param markOrder
	 */
	public Series(Integer id, Integer seriesId, String title, String seriesUrl, String coverUrl, String describe, int total, String firstUrl, int mark, int markOrder) {
		super();
		this.id = id;
		this.seriesId = seriesId;
		this.title = title;
		this.seriesUrl = seriesUrl;
		this.coverUrl = coverUrl;
		this.describe = describe;
		this.total = total;
		this.firstUrl = firstUrl;
		this.mark = mark;
		this.markOrder = markOrder;
	}



	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getSeriesId() {
		return seriesId;
	}

	public void setSeriesId(Integer seriesId) {
		this.seriesId = seriesId;
	}

	public String getSeriesUrl() {
		return seriesUrl;
	}

	public void setSeriesUrl(String seriesUrl) {
		this.seriesUrl = seriesUrl;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getCoverUrl() {
		return coverUrl;
	}

	public void setCoverUrl(String coverUrl) {
		this.coverUrl = coverUrl;
	}

	public String getDescribe() {
		return describe;
	}

	public void setDescribe(String describe) {
		this.describe = describe;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public String getFirstUrl() {
		return firstUrl;
	}

	public void setFirstUrl(String firstUrl) {
		this.firstUrl = firstUrl;
	}

	public int getMark() {
		return mark;
	}

	public void setMark(int mark) {
		this.mark = mark;
	}

	public int getMarkOrder() {
		return markOrder;
	}

	public void setMarkOrder(int markOrder) {
		this.markOrder = markOrder;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((seriesId == null) ? 0 : seriesId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Series other = (Series) obj;
		if (seriesId == null) {
			if (other.seriesId != null)
				return false;
		} else if (!seriesId.equals(other.seriesId))
			return false;
		return true;
	}

	public Map<String, Object> toMap() {
		Map<String, Object> m = new HashMap<String, Object>();
		
		m.put("id", this.getId());
		m.put("title", this.getTitle());
		m.put("seriesId", this.getSeriesId());
		m.put("seriesUrl", this.getSeriesUrl());
		m.put("coverUrl", this.getCoverUrl());
		m.put("describe", this.getDescribe());
		m.put("total", this.getTotal());
		m.put("firstUrl", this.getFirstUrl());
		m.put("mark", this.getMark());
		m.put("markOrder", this.getMarkOrder());

		return m;
	}

}